import 'babel-polyfill';
import Vue from 'vue'
import VueRouter from 'vue-router';
import App from './App'
import routes from '../../routes/index.js';
import store from '../../vuex/store.js';
import iView from 'iview';
import Config from '../../config/config.js';
import 'iview/dist/styles/iview.css';
import '../../assets/css/main.css';
import { $http } from '../../utils/fetch.js'
Vue.use(VueRouter);
Vue.use(iView);
Vue.config.productionTip = false;
// 路由配置
"use strict";
const router = new VueRouter({
  routes: routes,
  mode: Config.mode
})
Vue.prototype.$http = $http;
// 验证token微信授权
/*router.beforeEach((to, from, next) => {
    let url_token = to.query.token;
    let token = window.localStorage.getItem('ccm-token');
    if(url_token){
        window.localStorage.setItem("ccm-token", url_token);
    }else if(!url_token && !token) {
        // 没有token跳转到网页授权接口
        window.localStorage.setItem("ccm-token", url_token);
        next({
            path: to.fullPath
        })
    }
    next()
});*/



new Vue(Vue.util.extend({ router, store }, App)).$mount('#app');
